package com.atung.parking.controller;

import com.atung.parking.config.result.ApiResult;
import com.atung.parking.request.query.AppQueryParkingIotRequest;
import com.atung.parking.service.ParkingIotService;
import com.atung.parking.service.ParkingPackageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wlt
 */
@RestController
@RequestMapping("/api/home")
@Api(tags = "小程序首页接口")
public class PageHomeController {
    @Resource
    private ParkingPackageService parkingPackageService;
    @Resource
    private ParkingIotService parkingIotService;
    @GetMapping("/recommend")
    @ApiOperation("小程序首页推荐停车场套餐")
    public ApiResult recommendParkingIotPackage(AppQueryParkingIotRequest appQueryParkingIotRequest){
        return parkingPackageService.appRecommendParkingPackage(appQueryParkingIotRequest);
    }
    @GetMapping("/parkingIot/query")
    @ApiOperation("小程序获取(预订车位列表)")
    public ApiResult appQueryParkingIot(AppQueryParkingIotRequest appQueryParkingIotRequest){
        return parkingIotService.appQueryParkingIotService(appQueryParkingIotRequest);
    }

    @GetMapping("/parkingPackage/query")
    @ApiOperation("小程序获取(套餐列表)")
    public ApiResult appRecommendParkingPackage(AppQueryParkingIotRequest appQueryParkingIotRequest){
        return parkingPackageService.appQueryParkingPackageService(appQueryParkingIotRequest);
    }


}
